{php include wl_template('common/header');}
<ul class="nav nav-tabs" id="myTab">
    <li class="active"><a href="javascript:;">下级客户</a></li>
</ul>
<div class="app-content">
    <div class="main" style="margin-top: 0;">
        <div class="app-filter">
            <div class="filter-list">
                <form action="" method="get" class="form-horizontal" role="form" id="form">
                    <input type="hidden" name="c" value="site" />
                    <input type="hidden" name="a" value="entry" />
                    <input type="hidden" name="m" value="{MODULE_NAME}" />
                    <input type="hidden" name="p" value="distribution" />
                    <input type="hidden" name="ac" value="dissysbase" />
                    <input type="hidden" name="do" value="lowpeople" />
                    <input type="hidden" name="memid" value="{$memid}" />
                    <div class="form-group">
                        <label class="col-sm-2 control-label">关键字类型</label>
                        <div class="col-sm-9">
                            <select name="type" class="form-control">
                                <option value="2" {if $_GPC['type'] == 2}selected{/if}>手机号</option>
                                <option value="4" {if $_GPC['type'] == 4}selected{/if}>真实姓名</option>
                                <option value="3" {if $_GPC['type'] == 3}selected{/if}>昵称</option>
                                <option value="5" {if $_GPC['type'] == 5}selected{/if}>MID</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">关键字</label>
                        <div class="col-sm-9">
                            <input type="text" class="form-control" name="keyword" id="keyword" value="{$_GPC['keyword']}" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label"></label>
                        <div class="col-sm-9">
                            <button class="btn btn-default"><i class="fa fa-search"></i> 搜索</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
        <div class="app-table-list">
            <div class="table-responsive">
                <table class="table table-hover">
                    <thead class="navbar-inner">
                    <tr>
                        <th style="width:40px;">MID</th>
                        <th style="width:60px;">头像</th>
                        <th style="width:90px;">昵称</th>
                        <th style="width:100px;">手机</th>
                        <th style="width:100px;">真实姓名</th>
                        <th style="width:120px;" class="text-center">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {loop $lowpeople $peoo}
                    <tr id="{$peoo['id']}">
                        <td>{$peoo['mid']}</td>
                        <td><img style="height: 50px;width: 50px;" src="{php echo tomedia($peoo['avatar'])}" ></td>
                        <td>{$peoo['nickname']}</td>
                        <td>{$peoo['mobile']}</td>
                        <td>{$peoo['realname']}</td>
                        <td class="text-center">
                            <a href="{php echo web_url('distribution/dissysbase/loworder', array('buymid' => $peoo['mid'],'memid'=>$memid))}">查看订单</a>
                            <a href="{php echo web_url('distribution/dissysbase/changeleadid',array('id'=>$peoo['mid']))}" onclick="setTimeout(de,1500);" data-toggle="ajaxModal"> - 修改上级</a>
                            <a href="{php echo web_url('distribution/dissysbase/unbind',array('id'=>$peoo['id']))}" data-toggle="ajaxRemove" data-confirm="此操作不可逆，会解除该用户与上级的绑定，确认吗？"  title="解除上下级绑定"> - 解除绑定</a>
                        </td>
                    </tr>
                    {/loop}
                    </tbody>
                </table>
            </div>
            <div class="app-table-foot clearfix">
                <div class="pull-left">

                </div>
                <div class="pull-right">
                    {$pager}
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    function de(){
        myrequire(['select2'], function() {
            console.log('111');
            $('.chosen-select').select2({
                ajax: {
                    url: "{php echo web_url('distribution/dissysbase/getuser')}",
                    dataType: 'json',
                    data: function (params) {
                        var query = { //请求的参数, 关键字和搜索条件之类的
                            search: params.term //select搜索框里面的value
                        }
                        // Query paramters will be ?search=[term]&page=[page]
                        return query;
                    },
                    processResults: function (data) {
                        return {
                            results: data  //必须赋值给results并且必须返回一个obj
                        };
                    }
                }
            });
        });
    }
</script>
{php include wl_template('common/footer');}